//
//  UIView+HBFrame.m
//  HBLibary
//
//  Created by Rambo on 2018/6/6.
//

#import "UIView+HBFrame.h"

@implementation UIView (HBFrame)

- (void)setHb_x:(CGFloat)hb_x{
    CGRect rect = self.frame;
    rect.origin.x = hb_x;
    self.frame = rect;
}

- (CGFloat)hb_x{
    return self.frame.origin.x;
}

- (void)setHb_y:(CGFloat)hb_y{
    CGRect rect = self.frame;
    rect.origin.y = hb_y;
    self.frame = rect;
}

- (CGFloat)hb_y{
    return self.frame.origin.y;
}

- (void)setHb_width:(CGFloat)hb_width{
    CGRect rect = self.frame;
    rect.size.width = hb_width;
    self.frame = rect;
}

- (CGFloat)hb_width{
    return self.frame.size.width;
}

- (void)setHb_height:(CGFloat)hb_height{
    CGRect rect = self.frame;
    rect.size.height = hb_height;
    self.frame = rect;
}

- (CGFloat)hb_height{
    return self.frame.size.height;
}

- (void)setHb_size:(CGSize)hb_size{
    CGRect rect = self.frame;
    rect.size = hb_size;
    self.frame = rect;
}

- (CGSize)hb_size{
    return self.frame.size;
}

- (void)setHb_origin:(CGPoint)hb_origin{
    CGRect rect = self.frame;
    rect.origin = hb_origin;
    self.frame = rect;
}

- (CGPoint)hb_origin{
    return self.frame.origin;
}

- (CGFloat)hb_maxX{
    return self.hb_x + self.hb_width;
}

- (CGFloat)hb_maxY{
    return self.hb_y + self.hb_height;
}

- (void)setHb_centerX:(CGFloat)hb_centerX{
    CGPoint center = self.center;
    center.x = hb_centerX;
    self.center = center;
}

- (CGFloat)hb_centerX{
    return self.center.x;
}

- (void)setHb_centerY:(CGFloat)hb_centerY{
    CGPoint center = self.center;
    center.y = hb_centerY;
    self.center = center;
}


- (CGFloat)hb_centerY{
    return self.center.y;
}

@end
